#define _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
#include<string.h>
int main()
{
	char str[5] = "ABCD";
	int k;
	int len = strlen(str);
	scanf("%d", &k);
	int _k = k % len;
	for (int i = 0; i < _k; i++)
	{
		int tmp;
		tmp = str[0];
		for (int j = 1; j < len; j++)
			str[j - 1]=str[j];
		str[3] = tmp;
	}
	printf("%s", str);
	return 0;
}